<template>
	<view class="list">
		<view class="message_top">
			<view class="message_top_title" :style="{top:computedTop}">核销记录</view>
			<view class="message_top_back" :style="{top:computedTop}" @click="Back">
				<image src="../../static/search/back.png" class="bfbimages"></image>
			</view>
		</view>
		
		
		<view class="message_body">
			<view class="message_body_inp">
				<u--input placeholder="请输入用户ID/昵称/手机号" prefixIcon="search" prefixIconStyle="font-size: 14px;color: #999999"
					shape="circle" border="none" @confirm='confirm' v-model="input"></u--input>
				<view class="message_body_btn">搜索</view>
			</view>
		</view>
		
		<view class="list_date">
			<view>
				<text style="color: #A8A7AA;">日期选择</text>
				<view class="flex">
					<image src="../../static/my/hui_sanjiao.png" class="bfbimages"></image>
				</view>
			</view>
			<view style="margin-left: 18rpx;">
				<text style="color: #A8A7AA;">优惠卷</text>
				<view class="flex">
					<image src="../../static/my/hui_sanjiao.png" class="bfbimages"></image>
				</view>
			</view>
		</view>
		
		<view class="list_list"  v-for="items in weiteItem">
			<view>
				<view>
					<view class="flex">
						<image :src="items.avatar" class="bfbimages"></image>
					</view>
					<text>{{item.nickname}}</text>
					<text style="color: #E80706;font-size: 28rpx;display: inline-block;margin-left: 20rpx;">ID:{{items.id}}</text>
				</view>
				<view>￥{{items.amount}}</view>
			</view>
			<view>券包类型：
			<text v-if="items.activity_type==1">现金红包</text>
			<text v-if="items.activity_type==2">优惠券</text>
			<text v-if="items.activity_type==3">邀约红包</text>
			<text v-if="items.activity_type==4">折扣价</text>
			</view>
			<view>抢包时间：{{items.receive_time}}</view>
			<view>核销时间：{{items.off_time}}</view>
			<view>签到时间：{{items.sign_start_time}}</view>
			<view>签退时间：{{items.sign_end_time}}</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				menuButtonInfo: null,
				input:'',
				weiteItem:[]
			}
		},
		computed: {
			computedTop() {
				if (this.menuButtonInfo) {
					return `${this.menuButtonInfo.height * 2 - 6}px`;
				}
				return '0px';
			},
		},
		onLoad() {
			const info = uni.getMenuButtonBoundingClientRect();
			this.menuButtonInfo = info;
			this.getWriteOffList()
		},
		methods: {
			getWriteOffList(){
				const token = uni.getStorageSync('token'); // 请根据实际情况获取 token
				uni.request({
					url:this.$uts + '/api/user/writeOffList',
					method:'POST',
					header:{
						'Authorization':`${'Bearer'} ${token}`,
						'server':1,
						'token':uni.getStorageSync('token')
					},
					success:res=>{
						this.weiteItem=res.data.data.data
						
						console.log(this.weiteItem)
					}
				})
			},
			confirm(){
				console.log(this.input);
			},
			Back() {
				uni.navigateBack()
			}
		}
	}
</script>

<style lang="scss">
	.list {
		width: 100vw;
		min-height: 100vh;
		float: left;
		background-color: #F6F8FB;
	}

	.message_top {
		width: 100%;
		height: 200rpx;
		position: relative;

		.message_top_title {
			width: 100%;
			text-align: center;
			font-family: PingFang SC, PingFang SC;
			font-weight: bold;
			font-size: 36rpx;
			color: #333333;
			position: absolute;
			left: 0;
			z-index: 2;
		}

		.message_top_back {
			width: 44rpx;
			height: 44rpx;
			position: absolute;
			left: 30rpx;
			z-index: 9;
		}
	}
	
	.message_body {
		width: 100%;
		height: 100rpx;
		border-radius: 50rpx;
		display: flex;
		align-items: center;
		justify-content: center;
	
		.message_body_inp {
			width: 670rpx;
			height: 80rpx;
			background: #FFFFFF;
			border-radius: 50rpx;
			display: flex;
			align-items: center;
			justify-content: space-between;
			padding-left: 10rpx;
			padding-right: 10rpx;
		}
	
		.message_body_btn {
			width: 116rpx;
			height: 64rpx;
			background: linear-gradient(270deg, #FE4624 0%, #FF8143 100%);
			border-radius: 40rpx;
			font-family: PingFang SC, PingFang SC;
			font-weight: 500;
			font-size: 28rpx;
			color: #FFFFFF;
			text-align: center;
			line-height: 64rpx;
		}
		

	}
	
	.list_date{
		width: 670rpx;
		height: 70rpx;
		margin: 10rpx auto 0;
		display: flex;
		align-items: center;
	}
	.list_date>view{
		min-width: 152rpx;
		height: 68rpx;
		background: #FFFFFF;
		border-radius: 34rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		padding-left: 8rpx;
		padding-right: 8rpx;
	}
	.list_date>view>view{
		width: 18rpx;
		height: 10rpx;
		text-align: center;
		line-height: 10rpx;
		margin-left: 20rpx;
	}
	
	.list_list{
		width: 710rpx;
		background: #FFFFFF;
		border-radius: 20rpx;
		margin: 20rpx auto 0;
		padding-top: 25rpx;
		padding-bottom: 25rpx;
	}
	.list_list>view:nth-child(1){
		width: 650rpx;
		height: 54rpx;
		display: flex;
		align-items: center;
		justify-content: space-between;
		margin: 0 auto;
		font-family: PingFang SC, PingFang SC;
		font-weight: bold;
		font-size: 32rpx;
		color: #333333;
	}
	.list_list>view:nth-child(1)>view:nth-child(1){
		width: 80%;
		height: 100%;
		display: flex;
		align-items: center;
	}
	.list_list>view:nth-child(1)>view:nth-child(1)>view:nth-child(1){
		width: 54rpx;
		height: 54rpx;
		border-radius: 50%;
		overflow: hidden;
		margin-right: 20rpx;
	}
	.list_list>view:nth-child(1)>view:nth-child(2){
		font-family: PingFang SC, PingFang SC;
		font-weight: bold;
		font-size: 32rpx;
		color: #FE4624;
	}
	.list_list>view:nth-child(2),
	.list_list>view:nth-child(3),
	.list_list>view:nth-child(4),
		.list_list>view:nth-child(5),
		.list_list>view:nth-child(6)
	{
		width: 650rpx;
		height: 26rpx;
		margin: 20rpx auto 0;
		font-family: PingFang SC, PingFang SC;
		font-weight: 500;
		font-size: 26rpx;
		color: #999999;
	}
</style>